package com.cloud.sso.common.util;

/**
 * Created by tyd on 2017-10-13.
 * @author tyd
 */
public class IpUtils {

    private static Integer IP_LENGTH = 4;

    private static String IP_SPLIT = ".";

    private static String UNKNOWN = "unknown";

    public static boolean checkIP(String ip) {
        if (ip == null || "".equals(ip) || UNKNOWN.equalsIgnoreCase(ip) || ip.split(IP_SPLIT).length != IP_LENGTH) {
            return false;
        }
        return true;
    }
}
